#coding=utf-8
from common.import_common import *

from vote.models import Vote

@login_required                         
def add(request, vote_id):
    vote = get_object_or_404(Vote, pk=vote_id)
    if vote.question.user == request.user:
        vote.add_star()
        return HttpResponse("ok")
    return HttpResponse("error")